package com.ssy.lingxi.purchase.config.redisson;

import com.ssy.lingxi.purchase.api.dto.response.bidding.QueryPriceDynamicResponse;

import java.util.Comparator;

public class QueryPriceDynamicsSort implements Comparator<QueryPriceDynamicResponse> {


    @Override
    public int compare(QueryPriceDynamicResponse o1, QueryPriceDynamicResponse o2) {
        if(o1.getSumPrice() > o2.getSumPrice()){
            return 1;
        }else if(o1.getSumPrice().equals(o2.getSumPrice())||o2.getId().equals(o1.getId())){
            return 0;
        }else {
            return -1;
        }
    }
}
